﻿namespace HRM.CORE.REPORT
{
    using DevExpress.Utils;
    using DevExpress.XtraPrinting;
    using DevExpress.XtraReports.UI;
    using Microsoft.VisualBasic;
    using HRM.CORE;
    
    
    using System; using Extra.ERP;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Drawing.Printing;
    using Extra.ERP;
    using Dictionary.ERP;
    using APP.HELPER.Utils.Security;

    public class rptListContract : XtraReport
    {
        private BottomMarginBand BottomMargin;
        private XRTableCell colContractCode;
        private XRTableCell colContractTime;
        private XRTableCell colEmployeeCode;
        private XRTableCell colFirstName;
        private XRTableCell colFromDate;
        private XRTableCell colLastName;
        private XRTableCell colOrder;
        private XRTableCell colSignDate;
        private XRTableCell colSigner;
        private XRTableCell colStatus;
        private XRTableCell colToDate;
        private IContainer components;
        private DetailBand Detail;
        private XRTableCell dtFromDate;
        private XRTableCell dtSignDate;
        private XRTableCell dtToDate;
        private GroupHeaderBand GroupHeader1;
        private HRM_CONTRACT l_Contract;
        private string m_Code;
        private string m_Filter;
        private int m_Level;
        private int m_Order;
        private XRPictureBox ptPhoto;
        private ReportFooterBand ReportFooter;
        private ReportHeaderBand ReportHeader;
        private TopMarginBand TopMargin;
        private XRLabel txtAddress;
        private XRLabel txtCompany;
        private XRTableCell txtContractCode;
        private XRTableCell txtContractTime;
        private XRLabel txtCurrentDate;
        private XRLabel txtDepartment;
        private XRTableCell txtEmployeeCode;
        private XRTableCell txtFirstName;
        private XRTableCell txtLastName;
        private XRTableCell txtOrder;
        private XRTableCell txtSigner;
        private XRTableCell txtStatus;
        private XRLabel txtTitle;
        private XRLabel xrLabel2;
        private XRTable xrTable1;
        private XRTable xrTable2;
        private XRTable xrTable3;
        private XRTableCell xrTableCell10;
        private XRTableCell xrTableCell11;
        private XRTableCell xrTableCell12;
        private XRTableCell xrTableCell7;
        private XRTableCell xrTableCell8;
        private XRTableCell xrTableCell9;
        private XRTableRow xrTableRow1;
        private XRTableRow xrTableRow2;
        private XRTableRow xrTableRow3;
        private XRTableRow xrTableRow4;

        public rptListContract(string Filter)
        {
            this.components = null;
            this.l_Contract = new HRM_CONTRACT();
            this.m_Filter = "0";
            this.m_Level = MyLogin.Level;
            this.m_Code = MyLogin.Code;
            this.m_Order = 0;
            this.InitializeComponent();
            this.m_Filter = Filter;
        }

        public rptListContract(int Level, string Code, string Filter)
        {
            this.components = null;
            this.l_Contract = new HRM_CONTRACT();
            this.m_Filter = "0";
            this.m_Level = MyLogin.Level;
            this.m_Code = MyLogin.Code;
            this.m_Order = 0;
            this.InitializeComponent();
            this.m_Level = Level;
            this.m_Code = Code;
            this.m_Filter = Filter;
        }

        private void chSex_BeforePrint(object sender, PrintEventArgs e)
        {
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void dtDate_BeforePrint(object sender, PrintEventArgs e)
        {
            try
            {
                this.dtSignDate.Text = Convert.ToDateTime(this.dtSignDate.Text).ToShortDateString();
            }
            catch
            {
            }
        }

        private void dtFromDate_BeforePrint(object sender, PrintEventArgs e)
        {
            try
            {
                this.dtFromDate.Text = Convert.ToDateTime(this.dtFromDate.Text).ToShortDateString();
            }
            catch
            {
            }
        }

        private void dtToDate_BeforePrint(object sender, PrintEventArgs e)
        {
            try
            {
                this.dtToDate.Text = Convert.ToDateTime(this.dtToDate.Text).ToShortDateString();
                if (DateTime.Now >= DateAndTime.DateAdd(DateInterval.Day, -10.0, Convert.ToDateTime(this.dtToDate.Text)))
                {
                    this.txtStatus.Text = "Sắp hết hạn (-)";
                }
                else
                {
                    this.txtStatus.Text = "";
                }
                if (Convert.ToDateTime(this.dtToDate.Text) < DateTime.Now)
                {
                    this.txtStatus.Text = "Đ\x00e3 hết hạn (x)";
                }
            }
            catch
            {
            }
        }

        private void InitializeComponent()
        {
            this.Detail = new DetailBand();
            this.xrTable2 = new XRTable();
            this.xrTableRow2 = new XRTableRow();
            this.txtOrder = new XRTableCell();
            this.txtContractCode = new XRTableCell();
            this.txtEmployeeCode = new XRTableCell();
            this.txtFirstName = new XRTableCell();
            this.txtLastName = new XRTableCell();
            this.txtContractTime = new XRTableCell();
            this.dtFromDate = new XRTableCell();
            this.dtToDate = new XRTableCell();
            this.txtSigner = new XRTableCell();
            this.dtSignDate = new XRTableCell();
            this.txtStatus = new XRTableCell();
            this.TopMargin = new TopMarginBand();
            this.BottomMargin = new BottomMarginBand();
            this.ReportHeader = new ReportHeaderBand();
            this.txtTitle = new XRLabel();
            this.txtAddress = new XRLabel();
            this.ptPhoto = new XRPictureBox();
            this.txtCompany = new XRLabel();
            this.xrLabel2 = new XRLabel();
            this.txtCurrentDate = new XRLabel();
            this.GroupHeader1 = new GroupHeaderBand();
            this.xrTable1 = new XRTable();
            this.xrTableRow1 = new XRTableRow();
            this.colOrder = new XRTableCell();
            this.colContractCode = new XRTableCell();
            this.colEmployeeCode = new XRTableCell();
            this.colFirstName = new XRTableCell();
            this.colLastName = new XRTableCell();
            this.colContractTime = new XRTableCell();
            this.colFromDate = new XRTableCell();
            this.colToDate = new XRTableCell();
            this.colSigner = new XRTableCell();
            this.colSignDate = new XRTableCell();
            this.colStatus = new XRTableCell();
            this.ReportFooter = new ReportFooterBand();
            this.xrTable3 = new XRTable();
            this.xrTableRow3 = new XRTableRow();
            this.xrTableCell7 = new XRTableCell();
            this.xrTableCell8 = new XRTableCell();
            this.xrTableCell9 = new XRTableCell();
            this.xrTableRow4 = new XRTableRow();
            this.xrTableCell10 = new XRTableCell();
            this.xrTableCell11 = new XRTableCell();
            this.xrTableCell12 = new XRTableCell();
            this.txtDepartment = new XRLabel();
            this.xrTable2.BeginInit();
            this.xrTable1.BeginInit();
            this.xrTable3.BeginInit();
            this.BeginInit();
            this.Detail.Controls.AddRange(new XRControl[] { this.xrTable2 });
            this.Detail.HeightF = 29.16667f;
            this.Detail.Name = "Detail";
            this.Detail.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.Detail.TextAlignment = TextAlignment.TopLeft;
            this.xrTable2.Borders = BorderSide.Bottom | BorderSide.Right | BorderSide.Left;
            this.xrTable2.LocationFloat = new PointFloat(0f, 0f);
            this.xrTable2.Name = "xrTable2";
            this.xrTable2.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.xrTable2.Rows.AddRange(new XRTableRow[] { this.xrTableRow2 });
            this.xrTable2.SizeF = new SizeF(1060f, 29.16667f);
            this.xrTable2.StylePriority.UseBorders = false;
            this.xrTable2.StylePriority.UsePadding = false;
            this.xrTable2.StylePriority.UseTextAlignment = false;
            this.xrTable2.TextAlignment = TextAlignment.MiddleLeft;
            this.xrTableRow2.Cells.AddRange(new XRTableCell[] { this.txtOrder, this.txtContractCode, this.txtEmployeeCode, this.txtFirstName, this.txtLastName, this.txtContractTime, this.dtFromDate, this.dtToDate, this.txtSigner, this.dtSignDate, this.txtStatus });
            this.xrTableRow2.Name = "xrTableRow2";
            this.xrTableRow2.Weight = 1.0;
            this.txtOrder.Name = "txtOrder";
            this.txtOrder.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtOrder.StylePriority.UsePadding = false;
            this.txtOrder.StylePriority.UseTextAlignment = false;
            this.txtOrder.Text = "txtOrder";
            this.txtOrder.TextAlignment = TextAlignment.MiddleLeft;
            this.txtOrder.Weight = 0.20832053669961761;
            this.txtOrder.BeforePrint += new PrintEventHandler(this.txtOrder_BeforePrint);
            this.txtContractCode.Name = "txtContractCode";
            this.txtContractCode.Text = "txtContractCode";
            this.txtContractCode.Weight = 0.66649284423900967;
            this.txtEmployeeCode.Name = "txtEmployeeCode";
            this.txtEmployeeCode.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtEmployeeCode.StylePriority.UsePadding = false;
            this.txtEmployeeCode.StylePriority.UseTextAlignment = false;
            this.txtEmployeeCode.Text = "txtEmployeeCode";
            this.txtEmployeeCode.TextAlignment = TextAlignment.MiddleLeft;
            this.txtEmployeeCode.Weight = 0.39441732341209257;
            this.txtFirstName.Name = "txtFirstName";
            this.txtFirstName.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtFirstName.StylePriority.UsePadding = false;
            this.txtFirstName.StylePriority.UseTextAlignment = false;
            this.txtFirstName.Text = "txtFirstName";
            this.txtFirstName.TextAlignment = TextAlignment.MiddleLeft;
            this.txtFirstName.Weight = 0.6432267611155329;
            this.txtLastName.Name = "txtLastName";
            this.txtLastName.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtLastName.StylePriority.UsePadding = false;
            this.txtLastName.StylePriority.UseTextAlignment = false;
            this.txtLastName.Text = "txtLastName";
            this.txtLastName.TextAlignment = TextAlignment.MiddleLeft;
            this.txtLastName.Weight = 0.29865891416982032;
            this.txtContractTime.Name = "txtContractTime";
            this.txtContractTime.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtContractTime.StylePriority.UsePadding = false;
            this.txtContractTime.StylePriority.UseTextAlignment = false;
            this.txtContractTime.Text = "txtContractTime";
            this.txtContractTime.TextAlignment = TextAlignment.MiddleLeft;
            this.txtContractTime.Weight = 0.42659626546867935;
            this.dtFromDate.Name = "dtFromDate";
            this.dtFromDate.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.dtFromDate.StylePriority.UsePadding = false;
            this.dtFromDate.StylePriority.UseTextAlignment = false;
            this.dtFromDate.Text = "dtFromDate";
            this.dtFromDate.TextAlignment = TextAlignment.MiddleCenter;
            this.dtFromDate.Weight = 0.49540597648484569;
            this.dtFromDate.BeforePrint += new PrintEventHandler(this.dtFromDate_BeforePrint);
            this.dtToDate.Name = "dtToDate";
            this.dtToDate.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.dtToDate.StylePriority.UsePadding = false;
            this.dtToDate.StylePriority.UseTextAlignment = false;
            this.dtToDate.Text = "dtToDate";
            this.dtToDate.TextAlignment = TextAlignment.MiddleCenter;
            this.dtToDate.Weight = 0.4740558805402576;
            this.dtToDate.BeforePrint += new PrintEventHandler(this.dtToDate_BeforePrint);
            this.txtSigner.Name = "txtSigner";
            this.txtSigner.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.txtSigner.StylePriority.UsePadding = false;
            this.txtSigner.StylePriority.UseTextAlignment = false;
            this.txtSigner.Text = "txtSigner";
            this.txtSigner.TextAlignment = TextAlignment.MiddleLeft;
            this.txtSigner.Weight = 0.71184483325721148;
            this.dtSignDate.Name = "dtSignDate";
            this.dtSignDate.Padding = new PaddingInfo(4, 0, 0, 0, 100f);
            this.dtSignDate.StylePriority.UsePadding = false;
            this.dtSignDate.StylePriority.UseTextAlignment = false;
            this.dtSignDate.Text = "dtSignDate";
            this.dtSignDate.TextAlignment = TextAlignment.MiddleCenter;
            this.dtSignDate.Weight = 0.47501981058511489;
            this.dtSignDate.BeforePrint += new PrintEventHandler(this.dtDate_BeforePrint);
            this.txtStatus.Name = "txtStatus";
            this.txtStatus.Weight = 0.74729451288198478;
            this.txtStatus.BeforePrint += new PrintEventHandler(this.txtStatus_BeforePrint);
            this.TopMargin.HeightF = 70f;
            this.TopMargin.Name = "TopMargin";
            this.TopMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.TopMargin.TextAlignment = TextAlignment.TopLeft;
            this.BottomMargin.HeightF = 56f;
            this.BottomMargin.Name = "BottomMargin";
            this.BottomMargin.Padding = new PaddingInfo(0, 0, 0, 0, 100f);
            this.BottomMargin.TextAlignment = TextAlignment.TopLeft;
            this.ReportHeader.Controls.AddRange(new XRControl[] { this.txtDepartment, this.txtTitle, this.txtAddress, this.ptPhoto, this.txtCompany, this.xrLabel2, this.txtCurrentDate });
            this.ReportHeader.Font = new Font("Times New Roman", 9.75f);
            this.ReportHeader.HeightF = 129f;
            this.ReportHeader.Name = "ReportHeader";
            this.ReportHeader.StylePriority.UseFont = false;
            this.txtTitle.Font = new Font("Times New Roman", 16f, FontStyle.Bold);
            this.txtTitle.LocationFloat = new PointFloat(2.000005f, 73.33333f);
            this.txtTitle.Name = "txtTitle";
            this.txtTitle.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtTitle.SizeF = new SizeF(1057.125f, 30.25001f);
            this.txtTitle.StylePriority.UseFont = false;
            this.txtTitle.StylePriority.UseTextAlignment = false;
            this.txtTitle.Text = "DANH S\x00c1CH HỢP ĐỒNG LAO ĐỘNG";
            this.txtTitle.TextAlignment = TextAlignment.MiddleCenter;
            this.txtAddress.Font = new Font("Times New Roman", 9.75f);
            this.txtAddress.LocationFloat = new PointFloat(152.5417f, 31.70837f);
            this.txtAddress.Name = "txtAddress";
            this.txtAddress.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtAddress.SizeF = new SizeF(423.875f, 17.70833f);
            this.txtAddress.StylePriority.UseFont = false;
            this.txtAddress.Text = "txtAddress";
            this.ptPhoto.LocationFloat = new PointFloat(3.000005f, 0f);
            this.ptPhoto.Name = "ptPhoto";
            this.ptPhoto.SizeF = new SizeF(88.54166f, 58.33333f);
            this.ptPhoto.Sizing = ImageSizeMode.ZoomImage;
            this.txtCompany.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.txtCompany.LocationFloat = new PointFloat(96.54166f, 10.00001f);
            this.txtCompany.Name = "txtCompany";
            this.txtCompany.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtCompany.SizeF = new SizeF(479.875f, 17.70833f);
            this.txtCompany.StylePriority.UseFont = false;
            this.txtCompany.Text = "txtCompany";
            this.xrLabel2.Font = new Font("Times New Roman", 9.75f);
            this.xrLabel2.LocationFloat = new PointFloat(96.54166f, 31.70827f);
            this.xrLabel2.Name = "xrLabel2";
            this.xrLabel2.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.xrLabel2.SizeF = new SizeF(56f, 17.70833f);
            this.xrLabel2.StylePriority.UseFont = false;
            this.xrLabel2.Text = "Địa Chỉ:";
            this.txtCurrentDate.Font = new Font("Times New Roman", 9.75f);
            this.txtCurrentDate.LocationFloat = new PointFloat(930.2866f, 10.00001f);
            this.txtCurrentDate.Name = "txtCurrentDate";
            this.txtCurrentDate.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtCurrentDate.SizeF = new SizeF(129.7134f, 17.70833f);
            this.txtCurrentDate.StylePriority.UseFont = false;
            this.txtCurrentDate.StylePriority.UseTextAlignment = false;
            this.txtCurrentDate.TextAlignment = TextAlignment.MiddleRight;
            this.GroupHeader1.Controls.AddRange(new XRControl[] { this.xrTable1 });
            this.GroupHeader1.HeightF = 38.54167f;
            this.GroupHeader1.Name = "GroupHeader1";
            this.xrTable1.AnchorVertical = VerticalAnchorStyles.Bottom;
            this.xrTable1.BackColor = Color.WhiteSmoke;
            this.xrTable1.Borders = BorderSide.All;
            this.xrTable1.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.xrTable1.LocationFloat = new PointFloat(0f, 0f);
            this.xrTable1.Name = "xrTable1";
            this.xrTable1.Rows.AddRange(new XRTableRow[] { this.xrTableRow1 });
            this.xrTable1.SizeF = new SizeF(1060f, 38.54167f);
            this.xrTable1.StylePriority.UseBackColor = false;
            this.xrTable1.StylePriority.UseBorders = false;
            this.xrTable1.StylePriority.UseFont = false;
            this.xrTable1.StylePriority.UseTextAlignment = false;
            this.xrTable1.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableRow1.Cells.AddRange(new XRTableCell[] { this.colOrder, this.colContractCode, this.colEmployeeCode, this.colFirstName, this.colLastName, this.colContractTime, this.colFromDate, this.colToDate, this.colSigner, this.colSignDate, this.colStatus });
            this.xrTableRow1.Font = new Font("Times New Roman", 9.25f, FontStyle.Bold);
            this.xrTableRow1.Name = "xrTableRow1";
            this.xrTableRow1.StylePriority.UseFont = false;
            this.xrTableRow1.Weight = 1.0;
            this.colOrder.CanGrow = false;
            this.colOrder.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colOrder.Name = "colOrder";
            this.colOrder.StylePriority.UseFont = false;
            this.colOrder.StylePriority.UseTextAlignment = false;
            this.colOrder.Text = "STT";
            this.colOrder.TextAlignment = TextAlignment.MiddleCenter;
            this.colOrder.Weight = 0.20832080060659885;
            this.colContractCode.CanGrow = false;
            this.colContractCode.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colContractCode.Name = "colContractCode";
            this.colContractCode.StylePriority.UseFont = false;
            this.colContractCode.Text = "M\x00e3 hợp đồng";
            this.colContractCode.Weight = 0.66649250125925075;
            this.colEmployeeCode.CanGrow = false;
            this.colEmployeeCode.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colEmployeeCode.Name = "colEmployeeCode";
            this.colEmployeeCode.StylePriority.UseFont = false;
            this.colEmployeeCode.StylePriority.UseTextAlignment = false;
            this.colEmployeeCode.Text = "M\x00e3 nh\x00e2n vi\x00ean";
            this.colEmployeeCode.TextAlignment = TextAlignment.MiddleCenter;
            this.colEmployeeCode.Weight = 0.39441745083245561;
            this.colFirstName.CanGrow = false;
            this.colFirstName.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colFirstName.Name = "colFirstName";
            this.colFirstName.StylePriority.UseFont = false;
            this.colFirstName.StylePriority.UseTextAlignment = false;
            this.colFirstName.Text = "Họ l\x00f3t";
            this.colFirstName.TextAlignment = TextAlignment.MiddleCenter;
            this.colFirstName.Weight = 0.64322646605592759;
            this.colLastName.CanGrow = false;
            this.colLastName.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colLastName.Name = "colLastName";
            this.colLastName.StylePriority.UseFont = false;
            this.colLastName.StylePriority.UseTextAlignment = false;
            this.colLastName.Text = "T\x00ean";
            this.colLastName.TextAlignment = TextAlignment.MiddleCenter;
            this.colLastName.Weight = 0.29865888637463484;
            this.colContractTime.CanGrow = false;
            this.colContractTime.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colContractTime.Name = "colContractTime";
            this.colContractTime.StylePriority.UseFont = false;
            this.colContractTime.StylePriority.UseTextAlignment = false;
            this.colContractTime.Text = "Thời hạn";
            this.colContractTime.TextAlignment = TextAlignment.MiddleCenter;
            this.colContractTime.Weight = 0.42659651261472081;
            this.colFromDate.CanGrow = false;
            this.colFromDate.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colFromDate.Name = "colFromDate";
            this.colFromDate.StylePriority.UseFont = false;
            this.colFromDate.StylePriority.UseTextAlignment = false;
            this.colFromDate.Text = "Từ ng\x00e0y";
            this.colFromDate.TextAlignment = TextAlignment.MiddleCenter;
            this.colFromDate.Weight = 0.49540590504596294;
            this.colToDate.CanGrow = false;
            this.colToDate.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colToDate.Name = "colToDate";
            this.colToDate.StylePriority.UseFont = false;
            this.colToDate.StylePriority.UseTextAlignment = false;
            this.colToDate.Text = "Đến ng\x00e0y";
            this.colToDate.TextAlignment = TextAlignment.MiddleCenter;
            this.colToDate.Weight = 0.4740555664136632;
            this.colSigner.CanGrow = false;
            this.colSigner.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colSigner.Name = "colSigner";
            this.colSigner.StylePriority.UseFont = false;
            this.colSigner.StylePriority.UseTextAlignment = false;
            this.colSigner.Text = "Người k\x00fd";
            this.colSigner.TextAlignment = TextAlignment.MiddleCenter;
            this.colSigner.Weight = 0.71184438907275649;
            this.colSignDate.CanGrow = false;
            this.colSignDate.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.colSignDate.Name = "colSignDate";
            this.colSignDate.StylePriority.UseFont = false;
            this.colSignDate.StylePriority.UseTextAlignment = false;
            this.colSignDate.Text = "Ng\x00e0y k\x00fd";
            this.colSignDate.TextAlignment = TextAlignment.MiddleCenter;
            this.colSignDate.Weight = 0.475020111612102;
            this.colStatus.CanGrow = false;
            this.colStatus.Name = "colStatus";
            this.colStatus.Text = "Trạng th\x00e1i";
            this.colStatus.Weight = 0.74729463294927045;
            this.ReportFooter.Controls.AddRange(new XRControl[] { this.xrTable3 });
            this.ReportFooter.HeightF = 84f;
            this.ReportFooter.Name = "ReportFooter";
            this.xrTable3.LocationFloat = new PointFloat(4.768372E-05f, 9.999974f);
            this.xrTable3.Name = "xrTable3";
            this.xrTable3.Rows.AddRange(new XRTableRow[] { this.xrTableRow3, this.xrTableRow4 });
            this.xrTable3.SizeF = new SizeF(1060f, 62.5f);
            this.xrTableRow3.Cells.AddRange(new XRTableCell[] { this.xrTableCell7, this.xrTableCell8, this.xrTableCell9 });
            this.xrTableRow3.Name = "xrTableRow3";
            this.xrTableRow3.Weight = 1.0;
            this.xrTableCell7.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.xrTableCell7.Name = "xrTableCell7";
            this.xrTableCell7.StylePriority.UseFont = false;
            this.xrTableCell7.StylePriority.UseTextAlignment = false;
            this.xrTableCell7.Text = "Người lập danh s\x00e1ch";
            this.xrTableCell7.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableCell7.Weight = 1.0;
            this.xrTableCell8.Name = "xrTableCell8";
            this.xrTableCell8.Weight = 1.0;
            this.xrTableCell9.Font = new Font("Times New Roman", 9.75f, FontStyle.Bold);
            this.xrTableCell9.Name = "xrTableCell9";
            this.xrTableCell9.StylePriority.UseFont = false;
            this.xrTableCell9.StylePriority.UseTextAlignment = false;
            this.xrTableCell9.Text = "Gi\x00e1m đốc";
            this.xrTableCell9.TextAlignment = TextAlignment.MiddleCenter;
            this.xrTableCell9.Weight = 1.0;
            this.xrTableRow4.Cells.AddRange(new XRTableCell[] { this.xrTableCell10, this.xrTableCell11, this.xrTableCell12 });
            this.xrTableRow4.Name = "xrTableRow4";
            this.xrTableRow4.Weight = 1.0;
            this.xrTableCell10.Font = new Font("Times New Roman", 9.75f, FontStyle.Italic);
            this.xrTableCell10.Name = "xrTableCell10";
            this.xrTableCell10.StylePriority.UseFont = false;
            this.xrTableCell10.StylePriority.UseTextAlignment = false;
            this.xrTableCell10.Text = "(K\x00fd v\x00e0 ghi r\x00f5 họ t\x00ean)";
            this.xrTableCell10.TextAlignment = TextAlignment.TopCenter;
            this.xrTableCell10.Weight = 1.0;
            this.xrTableCell11.Name = "xrTableCell11";
            this.xrTableCell11.Weight = 1.0;
            this.xrTableCell12.Font = new Font("Times New Roman", 9.75f, FontStyle.Italic);
            this.xrTableCell12.Name = "xrTableCell12";
            this.xrTableCell12.StylePriority.UseFont = false;
            this.xrTableCell12.StylePriority.UseTextAlignment = false;
            this.xrTableCell12.Text = "(K\x00fd v\x00e0 ghi r\x00f5 họ t\x00ean)";
            this.xrTableCell12.TextAlignment = TextAlignment.TopCenter;
            this.xrTableCell12.Weight = 1.0;
            this.txtDepartment.Font = new Font("Times New Roman", 12f, FontStyle.Bold);
            this.txtDepartment.LocationFloat = new PointFloat(0f, 103.5833f);
            this.txtDepartment.Name = "txtDepartment";
            this.txtDepartment.Padding = new PaddingInfo(2, 2, 0, 0, 100f);
            this.txtDepartment.SizeF = new SizeF(1057.125f, 19.83335f);
            this.txtDepartment.StylePriority.UseFont = false;
            this.txtDepartment.StylePriority.UseTextAlignment = false;
            this.txtDepartment.Text = "Department";
            this.txtDepartment.TextAlignment = TextAlignment.MiddleCenter;
            base.Bands.AddRange(new Band[] { this.Detail, this.TopMargin, this.BottomMargin, this.ReportHeader, this.GroupHeader1, this.ReportFooter });
            base.Landscape = true;
            base.Margins = new Margins(0x43, 0x2a, 70, 0x38);
            base.PageHeight = 0x33b;
            base.PageWidth = 0x491;
            base.PaperKind = PaperKind.A4;
            base.Version = "9.3";
            this.BeforePrint += new PrintEventHandler(this.rptListContract_BeforePrint);
            this.xrTable2.EndInit();
            this.xrTable1.EndInit();
            this.xrTable3.EndInit();
            this.EndInit();
        }

        private void LoadAllData()
        {
            this.txtCurrentDate.Text = DateTime.Now.ToShortDateString();
            this.LoadDepartment();
            DataSet set = new DataSet();
            DataTable list = new DataTable();
            if (this.m_Filter == "0")
            {
                list = this.l_Contract.GetList(this.m_Level, this.m_Code);
                this.txtTitle.Text = "DANH S\x00c1CH TẤT CẢ HỢP ĐỒNG LAO ĐỘNG";
            }
            else if (this.m_Filter == "1")
            {
                list = this.l_Contract.GetListJustExpiration(this.m_Level, this.m_Code);
                this.txtTitle.Text = "DANH S\x00c1CH SẮP HẾT HẠN HĐLĐ";
            }
            else if (this.m_Filter == "2")
            {
                list = this.l_Contract.GetListExpiration(this.m_Level, this.m_Code);
                this.txtTitle.Text = "DANH S\x00c1CH Đ\x00c3 HẾT HẠN HĐLĐ";
            }
            else
            {
                list = this.l_Contract.GetCurrentList(this.m_Level, this.m_Code);
                this.txtTitle.Text = "DANH S\x00c1CH HỢP ĐỒNG LAO ĐỘNG";
            }
            set.Tables.Add(list);
            base.DataSource = set;
            this.txtContractCode.DataBindings.Add("Text", base.DataSource, "ContractCode");
            this.txtEmployeeCode.DataBindings.Add("Text", base.DataSource, "EmployeeCode");
            this.txtFirstName.DataBindings.Add("Text", base.DataSource, "FirstName");
            this.txtLastName.DataBindings.Add("Text", base.DataSource, "LastName");
            this.txtContractTime.DataBindings.Add("Text", base.DataSource, "ContractTime");
            this.dtFromDate.DataBindings.Add("Text", base.DataSource, "FromDate");
            this.dtToDate.DataBindings.Add("Text", base.DataSource, "ToDate");
            this.txtSigner.DataBindings.Add("Text", base.DataSource, "Signer");
            this.dtSignDate.DataBindings.Add("Text", base.DataSource, "SignDate");
        }

        private void LoadDepartment()
        {
            if (this.m_Level == 0)
            {
                this.txtDepartment.Text = "";
            }
            else if (this.m_Level == 1)
            {
                HRM_BRANCH hrm_branch = new HRM_BRANCH();
                hrm_branch.Get(this.m_Code);
                this.txtDepartment.Text = "Đơn vị: " + hrm_branch.BranchName;
            }
            else if (this.m_Level == 2)
            {
                HRM_DEPARTMENT hrm_department = new HRM_DEPARTMENT();
                hrm_department.Get(this.m_Code);
                this.txtDepartment.Text = "Đơn vị: " + hrm_department.DepartmentName;
            }
            else if (this.m_Level == 3)
            {
                HRM_GROUP hrm_group = new HRM_GROUP();
                hrm_group.Get(this.m_Code);
                this.txtDepartment.Text = "Đơn vị: " + hrm_group.GroupName;
            }
        }

        private void rptListContract_BeforePrint(object sender, PrintEventArgs e)
        {
            this.LoadAllData();
            ////if (MyInfo.Get(MyEncryption.Encrypt("ERP01", "123654", true)) == "OK")
            {
                this.txtCompany.Text = "";//MyInfo.Company.ToUpper();
                this.txtAddress.Text = "";// MyInfo.Address;
                this.ptPhoto.Image = null;// MyInfo.Photo;
            }
        }

        private void txtOrder_BeforePrint(object sender, PrintEventArgs e)
        {
            this.m_Order++;
            this.txtOrder.Text = this.m_Order.ToString();
        }

        private void txtStatus_BeforePrint(object sender, PrintEventArgs e)
        {
        }
    }
}

